<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      background-color: #f00;
      text-align: center;
    }

    .box span {
      background-color: #0f0;
    }

    .container {
      background-color: #00f;
      width: 100px;
      height: 100px;
      /* margin: 0 auto; */
    }
  </style>
</head>

<body>

  <div class="box">
    <span>我是span元素</span>
    <div class="container"></div>
  </div>

</body>

</html>